package com.haixiaoke.saas.common.tenant;

/**
 * 租户上下文
 *
 * @author zhiping
 * @date 2023-10-28 15:26:03
 */
public class TenantContext {

    private static final ThreadLocal<String> contextHolder = new ThreadLocal<>();

    public static void setTenantId(String tenantId) {
        contextHolder.set(tenantId);
    }

    public static String getTenantId() {
        return contextHolder.get();
    }

    public static void clearTenantId() {
        contextHolder.remove();
    }
}
